﻿using UnityEngine;
using System.Collections;

public class Retry : MonoBehaviour {

	void Start(){
	}


	// Update is called once per frame
	void Update () {
		
		//タッチ検出処理
		if(Input.touchCount == 1){
			
			Vector2 tapPoint = Camera.main.ScreenToWorldPoint (Input.mousePosition);
			Collider2D col = Physics2D.OverlapPoint (tapPoint);
			if (col == this.collider2D) {
				//次のシーンへ
				AdBannerObserver.Initialize("ca-app-pub-9485049371262479/1001293949", "", 30);
				FadeManager.Instance.LoadLevel("InGame",1.0f);
			}
			
		}
		
		//マウス検出処理（デバッグ用）
		if (Input.GetMouseButtonDown (0)) {
			
			Vector2 tapPoint = Camera.main.ScreenToWorldPoint (Input.mousePosition);
			Collider2D col = Physics2D.OverlapPoint (tapPoint);
			if (col == this.collider2D) {
				//次のシーンへ
				AdBannerObserver.Initialize("ca-app-pub-9485049371262479/1001293949", "", 30);
				FadeManager.Instance.LoadLevel("InGame",1.0f);
			}
			
		}
		
	}

}
